import java.util.*;
public class NGuessNumberTest {
    void generateAnswerTest(){
        NGuessNumber nGuessNumber = new NGuessNumber();
        int [] a = nGuessNumber.generateAnswer();
        assert a.length==4:"有"+a.length+"个数";
        for (int i = 0;i<a.length;i++){
            assert a[i]<10 && a[i]>=0:"第"+i+"个数："+a[i];
        }
    }
    void getPlayerInputTest(){
        NGuessNumber nGuessNumber = new NGuessNumber();
        int [] a = nGuessNumber.getPlayerInput();
        assert a.length==4:"有"+a.length+"个数";
        for (int i = 0;i<a.length;i++){
            assert a[i]<10 && a[i]>=0:"第"+i+"个数："+a[i];
        }
    }
    void compareGuessAnswerTest(){
        NGuessNumber nGuessNumber = new NGuessNumber();
        int [] a = nGuessNumber.compareGuessAnswer();
        System.out.println("位置和值全部正确的有"+a[0]);
        System.out.println("位置不正确但值正确的有"+a[1]);
    }
    void isWinTest(){
        NGuessNumber nGuessNumber = new NGuessNumber();
        boolean a = nGuessNumber.isWin();
        if (a){
            System.out.println("玩家胜利！");
        }else {
            System.out.println("游戏失败！");
        }
    }
}
